using System;
using System.Data;
using System.Collections.Generic;
namespace eTMS.DAO
{
    /********************************BEGIN SinhVienMonHocDAO****************************************/
    ///<summary>
    /// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
    /// <para>Date:10/08/2010 58:03:30</para>
    /// <para>Class Name: SinhVienMonHocDAO</para>
    /// <para>Description: Class access to table SinhVienMonHoc in database. Class for coder code here</para>
    ///</summary>


    public partial class SinhVienMonHocDAO
    {
        public DataSet SelectAllDSWithDiemMonHoc(int HocKy_ID, int NamHoc_ID, int LoaiDiem_ID, int MonHoc_ID, List<int> LsSinhVien)
        {
            IDbCommand cmd = this.CreateCommand();
            cmd.CommandText = @"SELECT        SinhVienMonHoc.SinhVienMonHoc_ID, SinhVienMonHoc.SinhVien_ID, DiemMonHoc.DiemMonHoc_ID, DiemMonHoc.LanThi, DiemMonHoc.Diem, 
                                            DiemMonHoc.LoaiDiem_ID
                                FROM            DiemMonHoc RIGHT JOIN
                                                         SinhVienMonHoc ON DiemMonHoc.SinhVienMonHoc_ID = SinhVienMonHoc.SinhVienMonHoc_ID AND LoaiDiem_ID=" + LoaiDiem_ID.ToString();
            cmd.CommandText += " WHERE SinhVienMonHoc.HocKy_ID=" + HocKy_ID.ToString();
            cmd.CommandText += " AND SinhVienMonHoc.NamHoc_ID=" + NamHoc_ID.ToString();
            cmd.CommandText += " AND SinhVienMonHoc.MonHoc_ID=" + MonHoc_ID.ToString();            
            cmd.CommandText += " AND SinhVienMonHoc.SinhVien_ID IN(" + string.Join(",", LsSinhVien.ConvertAll<string>(Convert.ToString).ToArray()) + ")";
            return this.SelectDS(cmd);
        }

    }
    /*****************************************************************************************************/
    /**********************************END SinhVienMonHocDAO*****************************************/
    /*****************************************************************************************************/
}

